package com.xawx.hch.finances.util;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.Application;
/**
 * Title: LoginActivity
 * Description: 
 * Copyright: Copyright (c) 2012
 * Company: Xawx Teachnology
 * CreateTime: Mar 6, 2012 10:40:36 AM
 * 
 * @author hch
 * @version %A%, %B%
 * @since JDK1.6
 */
public class ExitApplication extends Application {
	private List<Activity> activitys = new ArrayList<Activity>();
	private static ExitApplication instance;

	private ExitApplication() {
	}

	public static ExitApplication getInstance() {
		if (null == instance) {
			instance = new ExitApplication();
		}
		return instance;

	}

	public void addActivity(Activity activity) {
		activitys.add(activity);
	}


	public void exit() {
		for (Activity activity : activitys) {
			activity.finish();
		}
		 System.exit(0);
	}
}
